from django.shortcuts import render
from django.http import HttpResponse,HttpResponseRedirect


#权限验证处理
def verify(fun):
    def verify_api(request):
        if request.method == 'POST':
            
            try:
                if request.POST['verify_pswd'] == '123':
            
                    return fun(request)
                else:
                    return HttpResponse('权限验证失败')
            except KeyError:
                return HttpResponse('封号 ')
        elif request.method == 'GET':
            return HttpResponse('获取有误')
        
    return verify_api
